import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Firefox()
driver.get('https://www.kongfz.com/')
driver.maximize_window()
time.sleep(3)

# driver.find_element(By.XPATH,'//*[@id="nickName"]/span[1]').click()
# time.sleep(3)

# driver.find_element(By.CLASS_NAME,'login-btn').click()
# time.sleep(3)

# driver.switch_to.frame(driver.find_element(By.ID,'iframe_login'))
# time.sleep(3)
#
# driver.find_element(By.NAME,'username').send_keys('123456')
# time.sleep(2)
#
# driver.find_element(By.NAME,'password').send_keys('123456')
# time.sleep(3)

driver.find_element(By.XPATH,'//*[@id="navHeader"]/div/div[2]/div[5]/a/span').click()
time.sleep(5)

driver.switch_to.window(driver.window_handles[-1])
time.sleep(2)

driver.find_element(By.ID,'username').send_keys('13381144084')
time.sleep(5)

driver.find_element(By.NAME,'password').send_keys('grq200566++')
time.sleep(5)

driver.find_element(By.XPATH,'//*[@id="login"]/div[3]/input').click()
time.sleep(15)

driver.find_element(By.ID,'pic_upload').send_keys(r'C:\Users\15220\Desktop\壁纸\该.jpg')
time.sleep(10)


# from selenium import webdriver
# from selenium.webdriver.common.by import By
# import time
#
# driver = webdriver.Firefox()
# driver.maximize_window()
# driver.get('https://pypi.org/project/selenium/#files')
# time.sleep(10)
# driver.find_element(By.XPATH,'/html/body/main/div[3]/div/div/div[2]/div[4]/div[1]/div[2]/a[1]').click()
# time.sleep(20)




# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from selenium.webdriver.common.action_chains import ActionChains
# import time
# from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.support.ui import WebDriverWait
#
# driver = webdriver.Edge()
# driver.get('https://www.kongfz.cn/')
#
#
# # xt = driver.find_element(By.XPATH,'//*[@id="nickName"]/span[1]')
# # ActionChains(driver).move_to_element(xt).perform()
# # driver.implicitly_wait(12)
# #
# # # driver.find_element(By.CLASS_NAME,'login-btn').click()
#
# xs = WebDriverWait(driver,20,0.5).until(EC.presence_of_element_located((By.CLASS_NAME,'login-btn')))
# xs.click()